package com.glela.order.model.vo.order;

import java.util.Collection;
import java.util.LinkedList;
import java.util.List;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;

import com.glela.order.model.response.order.RespOrderGiftsProductVo;
import com.glela.order.model.response.order.RespOrderGiftsVo;

/**
 * 异常信息
 * @author zls
 *
 */
public class ErrorMsgVo {
	//	private boolean									hasAvlGoods;
	//	private boolean									hasInvalidGoods;
	//	private boolean									hasPriceChanger;
	private String								desPriceChanger	= StringUtils.EMPTY;		//价格变动描述
	private List<ErrorMsgGoods>					invalidGoods	= new LinkedList<>();		//失效商品
	private Collection<RespOrderGiftsProductVo>	invalidGifts	= new LinkedList<>();		//失效赠品
	private Collection<Object>					avlGoods		= new LinkedList<>();		//有效商品
	private RespOrderGiftsVo					avlGifts		= new RespOrderGiftsVo();	//有效赠品

	public void clear() {
		invalidGifts.clear();
		invalidGoods.clear();
		avlGoods.clear();
		avlGifts.getProducts().clear();
	}

	/** 是否有有效赠品 */
	public boolean isHasAvlGifts() {
		return CollectionUtils.isNotEmpty(avlGifts.getProducts());
	}

	/** 是否有有效商品 */
	public boolean isHasAvlGoods() {
		return CollectionUtils.isNotEmpty(avlGoods);
	}

	/** 有失效商品 */
	public boolean isHasInvalidGoods() {
		return CollectionUtils.isNotEmpty(invalidGoods);
	}

	/** 有失效赠品 */
	public boolean isHasInvalidGifts() {
		return CollectionUtils.isNotEmpty(invalidGifts);
	}

	/** 有价格变动 */
	public boolean isHasPriceChanger() {
		return StringUtils.isNotEmpty(desPriceChanger);
	}

	public String getDesPriceChanger() {
		return desPriceChanger;
	}

	public void setDesPriceChanger(String desPriceChanger) {
		this.desPriceChanger = desPriceChanger;
	}

	public List<ErrorMsgGoods> getInvalidGoods() {
		return invalidGoods;
	}

	public Collection<RespOrderGiftsProductVo> getInvalidGifts() {
		return invalidGifts;
	}

	public Collection<Object> getAvlGoods() {
		return avlGoods;
	}

	public RespOrderGiftsVo getAvlGifts() {
		return avlGifts;
	}

}
